package ch9.thread3;

public class Worker extends Thread {
	public Worker(String n) {
		super(n);
	}

	@Override
	public void run() {
		while (true) {
			System.out.println(super.getName() + "干活了额");
			System.out.println("干了一会，休息一下");
			try {
				sleep(1200);
				System.out.println("睡到自然醒，继续干活");
			} catch (InterruptedException e) {
				e.printStackTrace();
				System.out.println("被吵醒了，不睡了，继续干活");
			}
		}
	}
}
